package com.guit.hrms.mapper;

import com.guit.hrms.po.Employee;
import com.guit.hrms.po.Role;
import com.guit.hrms.vo.EmployeeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface QueryMapper {

    List<EmployeeVO> query(Integer department, Integer deptType, Integer position);

    /**
     * 通过id查找员工信息
     * @return 员工信息
     */
    @Select("select * from employees where employee_id = #{employeeId}")
    Employee getById(String employeeId);

    /**
     * 根据员工号获取角色
     * @param employeeId 员工号
     * @return 角色
     */
    @Select("select * from roles where id=(select role_id from employee_roles where employee_id=#{employeeId})")
    Role getRoleById(String employeeId);

    /**
     * 根据角色
     *
     */

    /**
     * 根据应聘者id查询对应的员工工号
     * @param id 应聘者id
     * @return 员工工号
     */
    @Select("select employee_id from employees where interviewee_id = #{id}")
    String getByIntervieweeId(Integer id);
}
